package com.sample.weather3dwidget;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Cap;
import android.graphics.Paint.Style;
import android.util.AttributeSet;
import android.view.View;
import java.util.Calendar;

public class PointerView extends View
{
  private Calendar mCalendar = Calendar.getInstance();
  private Paint mPaint = new Paint(1);
  private int width = getResources().getDimensionPixelOffset(R.dimen.line_width);

  public PointerView(Context paramContext)
  {
    super(paramContext);
  }

  public PointerView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }

  public PointerView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
  }

  protected void onDraw(Canvas paramCanvas)
  {
    this.mCalendar.setTimeInMillis(System.currentTimeMillis());
    int i = this.mCalendar.get(11);
    int j = this.mCalendar.get(12);
    int k = this.mCalendar.get(13);
    this.mPaint.setStyle(Paint.Style.FILL);
    this.mPaint.setStrokeCap(Paint.Cap.ROUND);
    this.mPaint.setColor(-1);
    paramCanvas.drawCircle(getWidth() / 2, getHeight() / 2, 10.0F, this.mPaint);
    paramCanvas.save();
    paramCanvas.translate(getHeight() / 2, getWidth() / 2);
    paramCanvas.rotate(360.0F * k / 60.0F);
    this.mPaint.setStyle(Paint.Style.STROKE);
    this.mPaint.setStrokeWidth(0.5F * this.width);
    paramCanvas.drawLine(0.0F, 0.0F, 0.0F, 0.8F * (-getHeight() / 2), this.mPaint);
    paramCanvas.restore();
    paramCanvas.save();
    paramCanvas.translate(getHeight() / 2, getWidth() / 2);
    paramCanvas.rotate(360.0F * j / 60.0F);
    this.mPaint.setStyle(Paint.Style.STROKE);
    this.mPaint.setStrokeWidth(this.width);
    paramCanvas.drawLine(0.0F, 0.0F, 0.0F, 0.6F * (-getHeight() / 2), this.mPaint);
    paramCanvas.restore();
    paramCanvas.save();
    paramCanvas.translate(getHeight() / 2, getWidth() / 2);
    paramCanvas.rotate(360.0F * (i % 12) / 12.0F + j * 30 / 60.0F);
    this.mPaint.setStyle(Paint.Style.STROKE);
    this.mPaint.setStrokeWidth(1.5F * this.width);
    paramCanvas.drawLine(0.0F, 0.0F, 0.0F, 0.4F * (-getHeight() / 2), this.mPaint);
    paramCanvas.restore();
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    super.onMeasure(paramInt1, paramInt2);
    int i = Math.min(getMeasuredHeight(), getMeasuredWidth());
    setMeasuredDimension(i, i);
  }
}

/* Location:           C:\Users\jtxiang\Desktop\左右移动效果_dex2jar.jar
 * Qualified Name:     com.example.maga.perspectiveview.PointerView
 * JD-Core Version:    0.6.0
 */